<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        在一个对象上建立多层拦截网
     -->
     <script>
        const target = {
            foo: 'bar'
        }
        const firstProxy = new Proxy(target, {
            get() {
                console.log('firsst proxy')
                return Reflect.get(...arguments)
            }
        })

        const secondProxy = new Proxy(firstProxy, {
            get() {
                console.log('second proxy')
                return Reflect.get(...arguments)
            }
        })

        console.log(secondProxy.foo)
        // second proxy
        // firsst proxy
        // bar
     </script>
</body>
</html>